<%--
  Created by IntelliJ IDEA.
  User: magee
  Date: 2021/9/9
  Time: 2:44
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>小滴课堂开发者论坛</title>
    <!-- Bootstrap -->
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/bootstrap.min.css">

</head>
<body>
<!-- jQuery (Bootstrap 的所有 JavaScript 插件都依赖 jQuery，所以必须放在前边) -->
<script src="${pageContext.request.contextPath}/static/jquery-3.6.0.min.js"></script>
<!-- 加载 Bootstrap 的所有 JavaScript 插件。你也可以根据需要只加载单个插件。 -->
<script src="${pageContext.request.contextPath}/static/bootstrap.min.js"></script>

<div style="margin-top: 100px">
    <form class="form-horizontal" role="form" action="${pageContext.request.contextPath}/topic?method=addTopic" method="post">
        <!--标题-->
        <div class="form-group">
            <label class="col-sm-2">标题</label>
            <div class="col-lg-3">
                <input type="text" class="form-control" name="title" placeholder="标题">
            </div>
        </div>

        <!--分类-->
        <div class="form-group">
            <label class="col-sm-2">分类</label>
            <select class="form-control" name="c_id">
                <c:forEach items="${categoryList}" var="category">
                    <option value="${category.id}" >
                            ${category.name}
                    </option>
                </c:forEach>
            </select>
        </div>

        <!--内容-->
        <div class="form-group">
            <label class="col-sm-2">标题</label>
            <div class="col-lg-8">
                <textarea class="form-control" name="content" placeholder="请输入内容" ></textarea>
            </div>
        </div>


        <!--提交-->
        <div class="form-group">
            <div class="col-sm-offset-2 col-lg-3">
                <button type="submit" class="btn btn-default">提交</button>
            </div>
        </div>
    </form>
</div>


</body>
</html>
